package com.yj.jason.jsondemo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import android.view.View;

import com.scwang.smartrefresh.header.MaterialHeader;
import com.scwang.smartrefresh.layout.constant.SpinnerStyle;
import com.scwang.smartrefresh.layout.footer.BallPulseFooter;
import com.yj.jason.baselibrary.view.RecyclerView.CommonAdapter.CommonRecyclerAdapter;
import com.yj.jason.baselibrary.view.RecyclerView.CommonAdapter.ViewHolder;
import com.yj.jason.jsondemo.adapter.OnItemCallbackHelper;
import com.yj.jason.jsondemo.adapter.SlidingAdapter;
import com.yj.jason.jsondemo.fragment.MySmartRefrehsLayout;

import java.util.ArrayList;
import java.util.List;

public class DragHelperActivity extends AppCompatActivity {

    private RecyclerView recyclerView;
    private List<Person> mBeans=new ArrayList<>();

    private LinearLayoutManager mLayoutManager;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_drag_helper);




        recyclerView=findViewById(R.id.recyclerView);


/*
        final MySmartRefrehsLayout refreshLayout = (MySmartRefrehsLayout) findViewById(R.id.refreshLayout);
//设置 Header 为 贝塞尔雷达 样式
        refreshLayout.setRefreshHeader(new MaterialHeader(this));
//设置 Footer 为 球脉冲 样式
        refreshLayout.setRefreshFooter(new BallPulseFooter(this).setSpinnerStyle(SpinnerStyle.Scale));*/

        for(int i=0;i<20;i++){
            Person person=new Person("总页防水等级"+i,i);
            mBeans.add(person);
        }


        mLayoutManager=new LinearLayoutManager(this);

        recyclerView.setLayoutManager(mLayoutManager);


        recyclerView.setAdapter(new CommonRecyclerAdapter<Person>(this,mBeans,R.layout.item_2) {
            @Override
            public void convert(ViewHolder holder, Person item) {
                holder.setText(R.id.tv_item,item.getName());
            }

        });



    }


}
